/*** Eclipse Class Decompiler plugin, copyright (c) 2012 Chao Chen (cnfree2000@hotmail.com) ***/
package com.qihoo.gamecenter.sdk.pay.j;

import android.content.Context;
import android.text.TextUtils;
import com.qihoo.gamecenter.sdk.common.f.b;
import com.qihoo.gamecenter.sdk.common.h.d;
import com.qihoo.gamecenter.sdk.common.h.d.a;
import com.qihoo.gamecenter.sdk.common.i.f;
import com.qihoo.gamecenter.sdk.common.i.s;
import com.qihoo.gamecenter.sdk.pay.k.c;
import java.util.Map;
import java.util.TreeMap;
import org.json.JSONObject;

public class h extends d {
    public h(Context paramContext, d.a parama) {
        super(paramContext, parama, true);
    }

    protected String a(Context paramContext, String[] paramArrayOfString) {
        return null;
    }

    protected String a() {
        return "http://mgame.360.cn/credit/checkpin.json";
    }

    protected boolean b() {
        return true;
    }

    protected Map b(Context paramContext, String[] paramArrayOfString) {
        return c(paramContext, paramArrayOfString);
    }

    private Map c(Context paramContext, String[] paramArrayOfString) {
        String str1 = a(0, paramArrayOfString);
        if (TextUtils.isEmpty(str1)) {
            c.b("OAMo9CreditPayTask", new Object[] { "Mo9PayTask: qihooId is null!" });
            return null;
        }
        String str2 = a(1, paramArrayOfString);
        if (TextUtils.isEmpty(str2)) {
            c.b("OAMo9CreditPayTask", new Object[] { "Mo9PayTask: access token is null!" });
            return null;
        }
        String str3 = a(2, paramArrayOfString);
        if (TextUtils.isEmpty(str3)) {
            c.b("OAMo9CreditPayTask", new Object[] { "Mo9PayTask: order id is null!" });
            return null;
        }
        String str4 = a(3, paramArrayOfString);
        if (TextUtils.isEmpty(str4)) {
            c.b("OAMo9CreditPayTask", new Object[] { "Mo9PayTask: inner trade code is null!" });
            return null;
        }
        String str5 = a(4, paramArrayOfString);
        if (TextUtils.isEmpty(str5)) {
            c.b("OAMo9CreditPayTask", new Object[] { "Mo9PayTask: pin code is null!" });
            return null;
        }
        TreeMap localTreeMap = new TreeMap();
        localTreeMap.put("user_id", str1);
        localTreeMap.put("app_key", s.r(paramContext));
        localTreeMap.put("access_token", str2);
        localTreeMap.put("order_id", str3);
        localTreeMap.put("inner_trade_code", str4);
        localTreeMap.put("pin", str5);
        this.a = s.b();
        String str6 = f.c(s.a(localTreeMap, s.s(paramContext)), this.a);
        String str7 = b.a().a(this.a);
        localTreeMap = new TreeMap();
        localTreeMap.put("k", str7);
        localTreeMap.put("d", str6);
        c.a("OAMo9CreditPayTask", new Object[] { a(), "?k=", str7, "&d=", str6 });
        return localTreeMap;
    }

    protected a b(JSONObject paramJSONObject) {
        if (paramJSONObject != null) {
            a locala = new a();
            a.a(locala, paramJSONObject.optInt("error_code", -1));
            a.a(locala, paramJSONObject.optString("error"));
            a.b(locala, paramJSONObject.optString("order_id"));
            return locala;
        }
        return null;
    }

    public static class a {
        private int a = -1;
        private String b;
        private String c;

        public boolean a() {
            return (this.a == 0);
        }

        public int b() {
            return this.a;
        }

        public String c() {
            return this.b;
        }

        public String d() {
            return this.c;
        }
    }
}